/*
 * @Author: your name
 * @Date: 2022-03-11 14:47:31
 * @LastEditTime: 2022-03-31 17:34:56
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \beijing-dushixiang-manyuan\src\store\modules\orderForm.js
 */
import { reqOrderFormData } from '@/api/orderForm'

const actions = {
    async getOrderFormData({ commit }) {
        const result = await reqOrderFormData()
        commit('GET_ORDERFORM_DATA', result)
    }
}

const mutations = {
    GET_ORDERFORM_DATA(state, data) {
        state.orderFormData = data
    },
    ADD_Order(state, { data, type }) {
        state.addOrder = data
        state.detailType = type
    },
    ORDER_CODE(state, { data }) {
        state.order_code = data
    },
    COUNT_ORDER(state, num) {
        state.selectedSum = num
    },
    ROUTER_OPEN(state, { type }) {
        // console.log(type,"typetypefajsdl")
        state.router_open = type
    }
}

const state = {
    orderFormData: [],
    addOrder: false,
    detailType: '',//新增是add,详情是onlyread,修改是modify
    order_code: "",
    selectedSum: 0,//选中了几个订单
    router_open: false,

}

const getters = {

}

export default {
    state,
    mutations,
    actions,
    getters
}